package com.example.kafkaboot.controller;

import com.example.kafkaboot.model.User;
import org.springframework.kafka.annotation.KafkaHandler;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author cxx
 * @create 2020-03-30 16:39
 **/
@Component
@KafkaListener(id="group.users",topics = "test.user")
public class MultiMethods {

    @KafkaHandler
    public void handler(List<String> list,Acknowledgment ack){
        for (String name : list) {
            System.out.println ("group.users:"+name);
        }
        ack.acknowledge ();
    }

}
